<?php 
require './Core/Common.php';
use xfyzf\api\controller\Examine;
submit_head();
$queryArr  = input();

$pid=intval($queryArr['pid']);
if(empty($pid))sysmsg('PID不存在');
$sql = "SELECT * FROM pay_user WHERE pid=:pid LIMIT 1";
$params = ['pid' => $pid];
$userrow = safeSqlQuery($sql, $params)['result'][0]??'';
if(!$userrow)sysmsg('PID不存在');
if($userrow['zt']!=1)sysmsg('此账号已被封禁，已被禁止发起支付，如您是本支付平台商户，请联系站长');  

Examine::examine($queryArr,$userrow);

$type         = $queryArr['type'];

$QR_row = Examine::QR_row($type,$userrow,$queryArr['money']);

$time = time();

$price    = Examine::amount($type,$queryArr);
$trade_no = date("YmdHis").rand(11111,99999);


$ip = http_ip();
/**
 * 如果是微信支付则 创建一下 二维码 到目录 以便调用
 * 使用 wxpayqr_url函数来处理
*/
Examine::wxpayqr_url();//等写完 云端在说吧

if(!Examine::order()) sysmsg("写入订单失败 请检查数据 是否合法且完整");
Examine::submit();

?>